<script setup lang="ts">
import { ref, getCurrentInstance } from "vue";
import MenuItems from "./components/menuItems.vue";

interface PropType {}

withDefaults(defineProps<PropType>(), {});

const curIns = getCurrentInstance()?.proxy;

const isCollapse = ref(false);
const menuList = ref([
  { path: "/dashboard", title: "首页" },
  {
    path: "/system",
    title: "系统管理",
    children: [
      { path: "/role", title: "角色" },
      { path: "/user", title: "用户" },
    ],
  },
]);
</script>

<template>
  <el-menu
    :default-active="curIns?.$route.path"
    class="base-layout-aside select-none"
    :collapse="isCollapse"
    router
  >
    <MenuItems :menuList="menuList" />
  </el-menu>
</template>

<style lang="scss" scoped>
.base-layout-aside {
  height: 100%;
}
</style>
